package org.example.hospital_registration_system.enums;

public enum AppointmentStatus {
    PENDING(0, "预约中"),

    COMPLETED(1, "已完成"),

    EXPIRED(2, "已过期");

    AppointmentStatus(Integer code, String status) {
        this.code = code;
        this.status = status;
    }

    private Integer code;
    private String status;

    public static AppointmentStatus setStatusByCode(Integer code){
        switch(code){
            case 0: return PENDING;
            case 1: return COMPLETED;
            case 2: return EXPIRED;
            default:
                return EXPIRED;
        }
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
}